#pragma once
#include "Engine/AuxTypes.h"

inline DXGI_FORMAT DX10VarType ( TVariableType a_Type )
{
    switch (a_Type)
    {
    case TFLOAT:
        return DXGI_FORMAT_R32_FLOAT;
    case TFLOAT2:
        return DXGI_FORMAT_R32G32_FLOAT;
    case TFLOAT3:
        return DXGI_FORMAT_R32G32B32_FLOAT;
    case TFLOAT4:
        return DXGI_FORMAT_R32G32B32A32_FLOAT;
    case TUINT32:
        return DXGI_FORMAT_R32_UINT;
    case TUINT16:
        return DXGI_FORMAT_R16_UINT;
    case TINT32:
        return DXGI_FORMAT_R32_SINT;
    }
    return DXGI_FORMAT_UNKNOWN;
}

inline DXGI_FORMAT DX10ImageFmt ( TImageFormat a_Type )
{
    switch (a_Type)
    {
    case TR8:
        return DXGI_FORMAT_R8_UNORM;
    case TR8G8B8A8:
        return DXGI_FORMAT_R8G8B8A8_UNORM;
    case TR32F:
        return DXGI_FORMAT_R32_FLOAT;
    case TR32G32B32A32F:
        return DXGI_FORMAT_R32G32B32A32_FLOAT;
    
    }
    return DXGI_FORMAT_UNKNOWN;
}


inline D3D10_PRIMITIVE_TOPOLOGY DX10PrimitiveType ( TPrimitiveType a_Type )
{
    switch (a_Type)
    {
    case TPOINTLIST:
        return D3D10_PRIMITIVE_TOPOLOGY_POINTLIST;
    case TLINELIST:
        return D3D10_PRIMITIVE_TOPOLOGY_LINELIST;
    case TLINESTRIP:
        return D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP;
    case TTRIANGLELIST:
        return D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
    case TTRIANGLESTRIP:
        return D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
    case TLINELIST_ADJ:
        return D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ;
    case TLINESTRIP_ADJ:
        return D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ;
    case TTRIANGLELIST_ADJ:
        return D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ;
    case TTRIANGLESTRIP_ADJ:
        return D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ;
    }
    return D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED;
}